package co.yixiang.modules.shop.entity;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import co.yixiang.common.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
* @author frq
* @date 2020-05-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "YxSales",description = "业务员管理表")
public class YxSales extends BaseEntity {

    @ApiModelProperty(value = "用户id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer uid;

    @ApiModelProperty(value = "用户账户")
    private String username;

    @ApiModelProperty(value = "用户密码")
    private String password;

    /** 真实姓名 */
    @ApiModelProperty(value = "真实姓名")
    private String realName;

    /** 用户分组id   1.普通业务员   2.主管 */
    @ApiModelProperty(value = "用户分组id 1.普通业务员   2.主管 ")
    private Integer groupId;

    @ApiModelProperty(value = "用户头像")
    private String avatar;

    /** 手机号码 */
    @ApiModelProperty(value = "用户账户")
    private String phone;

    @ApiModelProperty(value = "添加时间")
    private Date addTime;

    @ApiModelProperty(value = "最后一次登录时间")
    private Date lastTime;

    @ApiModelProperty(value = "最后一次登录ip")
    private String lastIp;

    /** 1为正常，0为禁止 */
    @ApiModelProperty(value = "账户状态,1为正常，0为禁止")
    private Integer status;

    /** 部门ID */
    @ApiModelProperty(value = "部门ID")
    private String deptId;

    public void copy(YxSales source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}